Console :: BinPrint

Description:

The binprint function provides basic console output by printing all given parameters as hex output. This is very helpful when debugging.

Syntax:

BinPrint(sText as Any, …)

Parameters:

  • sText as Any
    • [input] Text passed to will be printed to the console.

Example:

BinPrint("This is a Number: " & 10 & ", and this is text.")

Remarks:

This function will take an infinite number of parameters. All parameters passed to this function will be printed to the console.


Console :: Cls

Description:

The cls function clears all text from the console.

Syntax:

Cls()

Parameters:

<None>

Example:

Cls()

Remarks:


Console :: Print

Description:

The print function provides basic console output.

Syntax:

Print(sText as Any, …)

Parameters:

  • sText as Any
    • [input] Text passed to will be printed to the console.

Example:

Print("This is a Number: " & 10 & ", and this is text.")

Remarks:

This function will take an infinite number of parameters. All parameters passed to this function will be printed to the console.


Console :: Prints

Description:

The prints function provides basic console output. Does not automatically print a trailing new line character.

Syntax:

Prints(sText as Any, …)

Parameters:

  • sText as Any
    • [input] Text passed to will be printed to the console.

Example:

Prints("This is a Number: " & 10 & ", and this is text.")

Remarks:

This function will take an infinite number of parameters. All parameters passed to this function will be printed to the console.

This function differs from the Print() function as it does not print a trailing line feed (new line) character.


Core :: DataLen

Description:

Calculates the actual number of bytes needed to store specified data.

Syntax:

DataLen(Data as Any) as Numeric

Parameters:

  • Data as Any
    • [Input] Any data whose binary data length needs to be determined.

Example:

Dim dDouble as Numeric = 3.14159

Print(DataLen(dDouble))


Core :: Exit

Description:

Returns a numeric result code to the calling process.

Syntax:

Exit(iReturnCode as Numeric = 0)

Parameters:

  • iReturnCode as Numeric
    • [Input] This code is returned to the calling process.

Example:

Exit(100)

Remarks:

Use exit when you need to return an error or success code to a calling process.


Core :: Return

Description:

Returns data to a calling procedure / function.

Syntax:

Return(Value as Any)

Parameters:

  • Value as Any
    • [Input] This value will be returned to the calling function.

Example:

Function MultiplyByTen(iValue as Numeric) as Numeric

Return(iValue * 10)

End Function

Print(MultiplyByTen(50))


Core :: Code.Inject

Description:

Injects code into the interpreter engine.

Syntax:

Code.Inject(sCode as String) as Numeric

Parameters:

  • sCode as String
    • [input] Line of code to be injected into the interpreter engine.

Example:

Code.Inject("Function InjectedTestProc(sText as String) as Numeric" _

& CrLf & "Return(sText & \", and this was passed out\")" _

& CrLf & "End Function")

Print(InjectedTestProc("This was passed in"))

Remarks:

The inject function will split the input on line feed characters and clean whitespaces from each line.


Core :: Code.Line

Description:

Gets file line of the currently executing statement.

Syntax:

Code.Line() as Numeric

Parameters:

<none>

Example:

Print(Code.Line())


Core :: Code.Scope

Description:

Gets the current scope level, the scope is incremented for every function fall, loop and logical block and decremented when the end of these blocks are met or exited explicitly.

Syntax:

Code.Scope() as Numeric

Parameters:

<none>

Example:

Print("Top scope " & Code.Scope())

Dim iLoop as Numeric = 0

While(iLoop < 5)

Print("Loop scope " & Code.Scope())

iLoop++

WEnd

Print("Bottom scope " & Code.Scope())


Core :: Code.Scope.Enter

Description:

Enters a new scope the current scope.

Syntax:

Code.Scope.Enter() as Numeric

Parameters:

<none>

Example:

Print(Code.Scope())

Code.Scope.Enter()

Print(Code.Scope())

Code.Scope.Exit()

Print(Code.Scope())

Remarks:

This is an advanced internal function used to give variables their scope.


Core :: Code.Scope.Exit

Description:

Exits the current scope.

Syntax:

Code.Scope.Exit() as Numeric

Parameters:

<none>

Example:

Print(Code.Scope())

Code.Scope.Enter()

Print(Code.Scope())

Code.Scope.Exit()

Print(Code.Scope())

Remarks:

This is an advanced internal function used to drop all variables in the highest scope and add precedence of variable access.


Date Time :: Date

Description:

Returns the current date in the optionally specified format.

Syntax:

Now(sDateFormat as String) as String

Parameters:

  • sDateFormat as String
    • [input] optional date format.

Example:

Print(Now())

Print(Now("MM.dd.yyyy"))

Remarks:

If no formats are specified, the function will returns the default format based on the computers locale settings.

Date Format:

Value | Description
D | Day of month as digits with no leading zero for single-digit days.
Dd | Day of month as digits with leading zero for single-digit days.
Ddd | Day of week as a three-letter abbreviation. The function uses the LOCALE_SABBREVDAYNAME value associated with the specified locale.
Dddd | Day of week as its full name. The function uses the LOCALE_SDAYNAME value associated with the specified locale.
M | Month as digits with no leading zero for single-digit months.
MM | Month as digits with leading zero for single-digit months.
MMM | Month as a three-letter abbreviation. The function uses the LOCALE_SABBREVMONTHNAME value associated with the specified locale.
MMMM | Month as its full name. The function uses the LOCALE_SMONTHNAME value associated with the specified locale.
y | Year as last two digits, with a leading zero for years less than 10. The same format as "yy."
yy | Year as last two digits, with a leading zero for years less than 10.
yyyy | Year represented by full four digits.
gg | Period/era string. The function uses the CAL_SERASTRING value associated with the specified locale. This element is ignored if the date to be formatted does not have an associated era or period string.


Date Time :: Now

Description:

Returns the current date and time in the optionally specified format.

Syntax:

Now(sDateFormat as String, sTimeFormat as String) as String

Parameters:

  • sDateFormat as String
    • [input] optional date format.
  • sTimeFormat as String
    • [input] optional time format.

Example:

Print(Now())

Print(Now("MM.dd.yyyy"))

Print(Now("MM.dd.yyyy", "hh|mm|ss"))

Remarks:

If no formats are specified, the function will returns the default format based on the computers locale settings.

Date Format:

Value | Description
D | Day of month as digits with no leading zero for single-digit days.
Dd | Day of month as digits with leading zero for single-digit days.
Ddd | Day of week as a three-letter abbreviation. The function uses the LOCALE_SABBREVDAYNAME value associated with the specified locale.
Dddd | Day of week as its full name. The function uses the LOCALE_SDAYNAME value associated with the specified locale.
M | Month as digits with no leading zero for single-digit months.
MM | Month as digits with leading zero for single-digit months.
MMM | Month as a three-letter abbreviation. The function uses the LOCALE_SABBREVMONTHNAME value associated with the specified locale.
MMMM | Month as its full name. The function uses the LOCALE_SMONTHNAME value associated with the specified locale.
y | Year as last two digits, with a leading zero for years less than 10. The same format as "yy."
yy | Year as last two digits, with a leading zero for years less than 10.
yyyy | Year represented by full four digits.
gg | Period/era string. The function uses the CAL_SERASTRING value associated with the specified locale. This element is ignored if the date to be formatted does not have an associated era or period string.

Time Format:

Value | Description
h | Hours with no leading zero for single-digit hours; 12-hour clock
hh | Hours with leading zero for single-digit hours; 12-hour clock
H | Hours with no leading zero for single-digit hours; 24-hour clock
HH | Hours with leading zero for single-digit hours; 24-hour clock
m | Minutes with no leading zero for single-digit minutes
mm | Minutes with leading zero for single-digit minutes
s | Seconds with no leading zero for single-digit seconds
ss | Seconds with leading zero for single-digit seconds
t | One character time marker string, such as A or P
tt | Multicharacter time marker string, such as AM or PM


Date Time :: TickCount

Description:

Gets the number of milliseconds that windows has been running. Appropriate for low precision timing.

Syntax:

TickCount() as Numeric

Parameters:

<none>

Example:

Print(TickCount())


Date Time :: Time

Description:

Returns the current time in the optionally specified format.

Syntax:

Now(sTimeFormat as String) as String

Parameters:

  • sTimeFormat as String
    • [input] optional time format.

Example:

Print(Now())

Print(Now("MM.dd.yyyy"))

Print(Now("MM.dd.yyyy", "hh|mm|ss"))

Remarks:

If no formats are specified, the function will returns the default format based on the computers locale settings.

Time Format:

Value | Description
h | Hours with no leading zero for single-digit hours; 12-hour clock
hh | Hours with leading zero for single-digit hours; 12-hour clock
H | Hours with no leading zero for single-digit hours; 24-hour clock
HH | Hours with leading zero for single-digit hours; 24-hour clock
m | Minutes with no leading zero for single-digit minutes
mm | Minutes with leading zero for single-digit minutes
s | Seconds with no leading zero for single-digit seconds
ss | Seconds with leading zero for single-digit seconds
t | One character time marker string, such as A or P
tt | Multicharacter time marker string, such as AM or PM


String :: ASCII

Description:

Returns the character code for a given ASCII character.

Syntax:

ASCII(sCharacter as String) as Numeric

Parameters:

  • sCharacter as String
    • [input] ASCII character whose value is to be determined.

Example:

Print("The letter A is code: " & ASCII("A"))


String :: Char

Description:

Returns the ASCII character for a given character code.

Syntax:

Char(iCode as Numeric) as String

Parameters:

  • iCode as Numeric
    • [input] ASCII character code.

Example:

Print("The Letter: " & Char(65))


String :: FormatNumeric

Description:

Converts a numeric value or string into a friendly formatted string

Syntax:

FormatNumeric(Value as Any, iDecimalPlaces as Numeric = 0) as String

Parameters:

  • Value as Any
    • [input] Numeric value (or string that can be converted to a numeric) whose value is to be formatted
  • DecimalPlaces as Numeric
    • [input] Number of decimal places to use in the conversion

Example:

Print(FormatNumeric(123456.789, 2))


String :: Len

Description:

Returns the length (number of characters) of a string.

Syntax:

Len(sText as String) as Numeric

Parameters:

  • sText as String
    • [input] Text whose length needs to be determined.

Example:

Dim sText as String = "Hello"

Print(Len(sText))


String :: String.Length

Description:

Returns the length (number of characters) of a string.

Syntax:

String.Length() as Numeric

Parameters:

· <none>

Example:

Dim sText as String = "Hello"

Print(sText.Length())


String :: Reverse

Description:

Reverses the specified input string, returns the result.

Syntax:

Reverse(sString as String) as String

Parameters:

  • sString as String
    • [input] String to be reversed.

Example:

Print(Reverse("Hello"))


String :: StrCmp

Description:

Determines if two strings are equal, case sensitive.

Syntax:

StrCmp(sText1 as String, sText2 as String) as Numeric

Parameters:

  • sText1 as String
    • [input] Text to be compared to sText2
  • sText2 as String
    • [input] Text to be compared to sText1

Returns:

· 0 if both strings are equal.

· -1 if sText1 is less than sText2

· 1 if sText1 is greater than sText2

Example:

Print(StrCmp("Hello", "Hello"))

Print(StrCmp ("Hello", "HELLO"))


String :: StrCmpi

Description:

Determines if two strings are equal without regard to case.

Syntax:

StrCmpi(sText1 as String, sText2 as String) as Numeric

Parameters:

  • sText1 as String
    • [input] Text to be compared to sText2
  • sText2 as String
    • [input] Text to be compared to sText1

Returns:

· 0 if both strings are equal.

· -1 if sText1 is less than sText2

· 1 if sText1 is greater than sText2

Example:

Print(StrCmpi("Hello", "Hello"))

Print(StrCmpi ("Hello", "HELLO"))


String :: StrCmp

String :: StrEql

Description:

Determines if two strings are equal, case sensitive.

Syntax:

StrEql(sText1 as String, sText2 as String) as Numeric

Parameters:

  • sText1 as String
    • [input] Text to be compared to sText2
  • sText2 as String
    • [input] Text to be compared to sText1

Returns:

· True if both strings are equal.

· False if the strings differ

Example:

Print(StrEql("Hello", "Hello"))

Print(StrEql ("Hello", "HELLO"))

Remarks:

StrEql and StrEqlI are faster than StrCmp and StrCmpI because they do not scan the entire string to figure a greater or lesser equality.


String :: StrCmpi

Description:

Determines if two strings are equal without regard to case.

Syntax:

StrEqlI(sText1 as String, sText2 as String) as Numeric

Parameters:

  • sText1 as String
    • [input] Text to be compared to sText2
  • sText2 as String
    • [input] Text to be compared to sText1

Returns:

· True if both strings are equal.

· False if the strings differ

Example:

Print(StrCmpi("Hello", "Hello"))

Print(StrCmpi ("Hello", "HELLO"))

Remarks:

StrEql and StrEqlI are faster than StrCmp and StrCmpI because they do not scan the entire string to figure a greater or lesser equality.


String :: SubString

Description:

Derives a new string from a portion of input text.

Syntax:

SubString(sText as String, iStartIndex as Numeric, iLength as Numeric = sText.Length() - iStartIndex) as String

Parameters:

  • sText as String
    • [input] String to pull sub-string from.
  • iStartIndex as Numeric
    • [input] The zero based starting index to derive the substring.
  • iLength as Numeric
    • [input] The number of characters from the starting index to return. This parameter is optional, if not specified, the function will return the remainder of the text after the starting index.

Example:

Print(SubString("Hello Cruel World", 6))

Print(SubString("Hello Cruel World", 6, 5))

Remarks:

The iLength parameter is optional. If not specified, the function will return the remainder of the text after the starting index.


String :: Val

Description:

Converts a string to a numeric.

Syntax:

Val(sText as String) as Numeric

Parameters:

  • sText as String
    • [input] Text whose value needs to be converted to a numeric type.

Example:

Dim sText as String = "123.456"

Print(Val(sText))


Threading :: Pause

Description:

Pauses the current thread and prompts the user to “press any key to continue…”

Syntax:

Pause()

Parameters:

<none>

Example:

Pause()

Remarks:

This function should only be used when the console is visible, otherwise it can cause a deadlock (such as in a web script).


Threading :: Sleep

Description:

Causes the current thread to “sleep” for a specified number of milliseconds.

Syntax:

Sleep(iMilliSeconds as Numeric)

Parameters:

  • iMilliSeconds as Numeric
    • [input] The number of milliseconds to wait before continuing.

Example:

Sleep()


Math :: Abs

Description:

Returns the absolute (positive) value of a given number.

Syntax:

Math.Abs(Value as Numeric) as Numeric

Parameters:

  • Value as Numeric
    • [input] Value of which the absolute is derived.

Example:

Math.Print(Abs(-1234))


Math :: Pow

Description:

Raises a given number by a specified power.

Syntax:

Math.Pow(X as Numeric, Y as Numeric) as Numeric

Parameters:

  • X as Numeric
    • [input] Base number to be raised.
  • Y as Numeric
    • [input] The power to raise the base by.

Example:

Math.Print(Pow(2, 5))


Math :: Random

Description:

Returns a pseudo-random number between the optional given range.

Syntax:

Math.Random(iMin as Numeric = 0, iMax as Numeric = 20150) as Numeric

Parameters:

  • iMin as Numeric
    • [input] optional minimum value for the generated random number.
  • iMax as Numeric
    • [input] optional maximum value for the generated random number.

Example:

Print(Math.Random(1, 10))


Math :: SetRandom

Description:

Set the seed for the pseudo-random number generator.

Syntax:

Math.SetRandom(iSeed as Numeric = TickCount())

Parameters:

  • iSeed as Numeric
    • [input] optional initial seed value for the random number generator.

Example:

Math.SetRandom(64654)

Remarks:

If no seed is passed into this function, the TickCount() is used.


XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx

Data :: Checksum

Description:

Generates a standard CRC32 checksum for the given input text data.

Syntax:

Checksum (sText as String, iLength as Numeric) as Numeric

Parameters:

  • sText as String
    • [input]
  • iLength as Numeric
    • [input]

Example:

Print(Checksum(“This is a test”))

Remarks:

The checksum function generates a CRC32 compatible with that of PKZip, WinZip and Ethernet using the 0x04C11DB7 polynomial


Data :: GUID

Description:

Generates a Globally Unique Identifier.

Syntax:

GUID() as String

Parameters:

<none>

Example:

Print(GUID())


XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx

Data :: SHA1

Description:

Generates a valid SHA1 hast string from the given text input data.

Syntax:

SHA1(sText as String, iLength as Numeric = -1) as String

Parameters:

  • sText as String
    • [input] Text data to use for SHA1 calculation
  • iLength as Numeric
    • [input] Optional length of the input text data.

Example:

Print(SHA1(“Test String”))


Data :: SQL.Connection.Close

Description:

Closes an open connection to SQL Server.

Syntax:

SQL.Connection.Close() as Numeric

Parameters:

<none>

Example:

Dim Cn2 as SQL.Connection

If(Cn2.Connect("(Local)"))

Dim rsTemp as SQL.RecordSet

If(Cn2.Execute("SELECT * FROM sys.objects WHERE type = 'u'", @rsTemp))

While(rsTemp.Fetch())

Print("(" & FormatNumeric(rsTemp.Value("object_id")) _

& ") - [" & rsTemp.Value("name") & "]" _

& " was created on \"" & rsTemp.Value("create_date") & "\"")

WEnd

rsTemp.Close()

Else

Print("Failed to execute")

End If

Cn2.Close()

Else

Print("Failed to connect to SQL server.")

End If


Data :: SQL.Connection.Connect

Description:

Connects to an instance of SQL Server.

Syntax:

SQL.Connection.Connect(Server as String, Database as String, Username as String, Password as String) as Numeric

Parameters:

  • Server as String
    • [input] Name of the SQL Server to connect to.
  • Database as String
    • [input] Optional database name to connect to.
  • Username as String
    • [input] Optional username to use for authentication, trusted authorization will be used if a username is not specified.
  • Password as String
    • [input] Optional password to use for authentication.

Example:

Dim Cn2 as SQL.Connection

If(Cn2.Connect("(Local)"))

Dim rsTemp as SQL.RecordSet

If(Cn2.Execute("SELECT * FROM sys.objects WHERE type = 'u'", @rsTemp))

While(rsTemp.Fetch())

Print("(" & FormatNumeric(rsTemp.Value("object_id")) _

& ") - [" & rsTemp.Value("name") & "]" _

& " was created on \"" & rsTemp.Value("create_date") & "\"")

WEnd

rsTemp.Close()

Else

Print("Failed to execute")

End If

Cn2.Close()

Else

Print("Failed to connect to SQL server.")

End If


Data :: SQL.Connection.Execute

Description:

Executes a statement against the SQL server, binds results to a record set if one is passed to the function – otherwise no data is returned from the query.

Syntax:

SQL.Connection.Execute(sSQL as String, RecordSet as Numeric) as Numeric

Parameters:

  • sSQL as String
    • [input] SQL statement to be executed by SQL server.
  • RecordSet as Numeric
    • [input] optional pointer to a record set object to bind the result set to.

Example:

Dim Cn2 as SQL.Connection

If(Cn2.Connect("(Local)"))

Dim rsTemp as SQL.RecordSet

If(Cn2.Execute("SELECT * FROM sys.objects WHERE type = 'u'", @rsTemp))

While(rsTemp.Fetch())

Print("(" & FormatNumeric(rsTemp.Value("object_id")) _

& ") - [" & rsTemp.Value("name") & "]" _

& " was created on \"" & rsTemp.Value("create_date") & "\"")

WEnd

rsTemp.Close()

Else

Print("Failed to execute")

End If

Cn2.Close()

Else

Print("Failed to connect to SQL server.")

End If


Data :: SQL.Connection.Value

Description:

Retrieves a value from the SQL Server via an unbound record set query. There is no record set to clean up after the call.

Syntax:

SQL.Connection.Value(sSQL as String) as String

Parameters:

  • sSQL as String
    • [input] Statement to be executed by SQL server, resulting value will be returned by the function.

Example:

Dim Cn2 as SQL.Connection

If(Cn2.Connect("(Local)")) 'SQL.Connect(Server, [Database], [Username], [Password])

Dim iItt as Numeric = 0

While(iItt < 10)

Print(Cn2.Value("SELECT GetDate()"))

Print(Cn2.Value("SELECT NewID()"))

Print(FormatNumeric(Cn2.Value("SELECT CheckSum(NewID())") / 6767.6767, 5))

Print(Cn2.Value("SELECT Convert(VarChar, GetDate(), 101)"))

iItt++

Wend

Cn2.Close()

Else

Print("Failed to connect to SQL server.")

End If


Data :: SQL.RecordSet.Close

Description:

Closes a bound record set and frees its resources.

Syntax:

SQL.RecordSet.Close() as Numeric

Parameters:

<none>

Example:

Dim Cn2 as SQL.Connection

If(Cn2.Connect("(Local)"))

Dim rsTemp as SQL.RecordSet

If(Cn2.Execute("SELECT * FROM sys.objects WHERE type = 'u'", @rsTemp))

While(rsTemp.Fetch())

Print("(" & FormatNumeric(rsTemp.Value("object_id")) _

& ") - [" & rsTemp.Value("name") & "]" _

& " was created on \"" & rsTemp.Value("create_date") & "\"")

WEnd

rsTemp.Close()

Else

Print("Failed to execute")

End If

Cn2.Close()

Else

Print("Failed to connect to SQL server.")

End If


Data :: SQL.RecordSet.Fetch

Description:

Fetches a new row from SQL Server through the bound record set object.

Syntax:

SQL.RecordSet.Fetch() as Numeric

Parameters:

<none>

Example:

Dim Cn2 as SQL.Connection

If(Cn2.Connect("(Local)"))

Dim rsTemp as SQL.RecordSet

If(Cn2.Execute("SELECT * FROM sys.objects WHERE type = 'u'", @rsTemp))

While(rsTemp.Fetch())

Print("(" & FormatNumeric(rsTemp.Value("object_id")) _

& ") - [" & rsTemp.Value("name") & "]" _

& " was created on \"" & rsTemp.Value("create_date") & "\"")

WEnd

rsTemp.Close()

Else

Print("Failed to execute")

End If

Cn2.Close()

Else

Print("Failed to connect to SQL server.")

End If


Data :: SQL.RecordSet.Value

Description:

Retrieves a value from SQL Server through the bound record set object

Syntax:

SQL.RecordSet.Value(Column as String) as String

Parameters:

  • Column as String
    • [input] Column name or numeric column index to retrieve data from.

Example:

Dim Cn2 as SQL.Connection

If(Cn2.Connect("(Local)"))

Dim rsTemp as SQL.RecordSet

If(Cn2.Execute("SELECT * FROM sys.objects WHERE type = 'u'", @rsTemp))

While(rsTemp.Fetch())

Print("(" & FormatNumeric(rsTemp.Value("object_id")) _

& ") - [" & rsTemp.Value("name") & "]" _

& " was created on \"" & rsTemp.Value("create_date") & "\"")

WEnd

rsTemp.Close()

Else

Print("Failed to execute")

End If

Cn2.Close()

Else

Print("Failed to connect to SQL server.")

End If


XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx

Web :: URLEncode

Description:

Converts the given input text to a URL encoded string, making it safe to pass/post from page to page via query string etc.

Syntax:

URLEncode(sText as String, iLength as Numeric -1) as String

Parameters:

  • sText as String
    • [input] The input text to be encoded.
  • iLength as Numeric
    • [input] Optional length of the input text.

Example:

Print(URLEncode(“This Text Message is Directed @ You!”))


XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx

Web :: URLDecode

Description:

Decodes the given input text to from a URL encoded string.

Syntax:

URLDecode(sText as String, iLength as Numeric -1) as String

Parameters:

  • sText as String
    • [input] The input text to be decoded.
  • iLength as Numeric
    • [input] Optional length of the input text.

Example:

Print(URLDecode(“This+Text+Message+is+Directed+%40+You!”))